package GUI;

import java.io.IOException;
import Kernel.Client;

public class Utilisateur extends javax.swing.JFrame {


	private static final long serialVersionUID = 1L;
	public static Client client;
	
	/** Crée une nouvelle instance de Utilisateur */
    public Utilisateur() {
        initComponents();
        this.setLocationRelativeTo(this.getParent());
    }
    /**
     * Crée une nouvelle instance de Utilisateur paramétrée
     * @param client
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public Utilisateur(Client client) throws IOException, ClassNotFoundException{
    	initComponents();
    	Utilisateur.client = client;
    	this.setLocationRelativeTo(this.getParent());
    }
    
    
    /**
	 * Initialisation des composants d'AWT.
	 */
    private void initComponents() {

        jButton_reservation = new javax.swing.JButton();
        jButton_quitter = new javax.swing.JButton();
        jLabel_menu = new javax.swing.JLabel();
        jButton_deconnexion = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jButton_reservation.setText("Réservation d'un billet");
        jButton_reservation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_reservationActionPerformed(evt);
            }
        });

        jButton_quitter.setText("Quitter");
        jButton_quitter.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_quitterActionPerformed(evt);
            }
        });

        jLabel_menu.setText("Panneau utilisateur");

        jButton_deconnexion.setText("Déconnexion");
        jButton_deconnexion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_deconnexionActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jButton_deconnexion)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 371, Short.MAX_VALUE)
                .addComponent(jButton_quitter)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel_menu)
                .addContainerGap(425, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(152, Short.MAX_VALUE)
                .addComponent(jButton_reservation, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(174, 174, 174))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel_menu)
                .addGap(112, 112, 112)
                .addComponent(jButton_reservation, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 133, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_deconnexion)
                    .addComponent(jButton_quitter))
                .addContainerGap())
        );

        pack();
    }

    private void jButton_quitterActionPerformed(java.awt.event.ActionEvent evt) {                                                
        this.setVisible(false);
        this.dispose();
    }                                               

    private void jButton_deconnexionActionPerformed(java.awt.event.ActionEvent evt) {                                                    
       Accueil ac = new Accueil();
       this.setVisible(false);
       ac.setVisible(true);
       this.dispose();
    }                                                   

    private void jButton_reservationActionPerformed(java.awt.event.ActionEvent evt) {                                                    
        Etape11 e1 = new Etape11();
        this.setVisible(false);
        e1.setVisible(true);
        
    }                                                   
                                                
                    
    private javax.swing.JButton jButton_deconnexion;
    private javax.swing.JButton jButton_quitter;
    private javax.swing.JButton jButton_reservation;
    private javax.swing.JLabel jLabel_menu;                   

}
